import { reactive } from 'vue'
import axios from "axios"

export default function () {
    let sheepDogList = reactive([
        "https://images.dog.ceo/breeds/sheepdog-shetland/n02105855_7607.jpg",
        "https://images.dog.ceo/breeds/sheepdog-shetland/n02105855_15820.jpg"
    ])

    async function addOne() {
        try {
            let result = await axios.get(
                "https://dog.ceo/api/breed/sheepdog/images/random"
            )
            console.log(result.data)
            sheepDogList.push(result.data.message)
        } catch (error) {
            alert(error)
        }
    }

    return { sheepDogList, addOne }
}